import {configureStore} from "@reduxjs/toolkit";
// import counterReducer from "./modules/countStore.tsx";
// import ChanneStore from "./modules/channeStore.tsx";
import userReducer from "./modules/usersStore.ts";
import themeReducer from "./modules/ThemeStore.ts";
import routerStore from "./modules/routerStore.ts";
// import TageStore from "./modules/tageViewStore.tsx";

import {useDispatch, useSelector} from "react-redux";

const store=configureStore({
    reducer:{
        // counter:counterReducer,
        // channel:ChanneStore,
        users:userReducer,
        theme:themeReducer,
        routerStore:routerStore,
        // tageStore:TageStore,


    }
})
export default store
// ✅ 正确声明 AppDispatch 类型
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;

// ✅ 创建支持 Thunk 的 useAppDispatch
export const useAppDispatch = () => useDispatch<AppDispatch>();